import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

typedef BackTapCallback = void Function();

/// 返回按钮通用组件，默认使用"⟨"图标
///
/// example：
///
/// BackBtnIcon(onTap: () => Get.back()) 返回上一页
///
class BackBtnIcon extends StatelessWidget {

  final BackTapCallback? onTap;

  const BackBtnIcon({super.key, this.onTap});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: IconButton(icon: Icon(Icons.arrow_back_ios, size: 70.w), onPressed: onTap,),
    );
  }
}
